#!/usr/bin/env python
#coding:utf-8

import web

urls = (
    '/', 'hello',
    '/add', 'add',
    )

app = web.application(urls, globals())

class hello:
    def GET(self):
        welcome = '<h2>Welcome to the Web.py App!</h2>'
        form = '''
        <hr>
        <form method="POST" action="/add">
        Name:<input type="text" name="name">
        <input type="submit" value="Submit">
        </form>
        '''
        return welcome + form

class add:
    def POST(self):
        name = web.input('name')
        #raise web.seeother('/')

    def GET(self):
        return name + 'sss'

if __name__ == '__main__':
    app.run()
